﻿@{
    Layout = null;
}
@model List<ElingOA6_Admin_DSJCJ.Model.Config>
<!DOCTYPE html>
<html>
<head>
    <title>Index</title>
    @if (false)
    {
        <script src="../../../../Scripts/jquery-vsdoc.js" type="text/javascript"></script>
        <script src="../../../../Scripts/ASPxScriptIntelliSense.js" type="text/javascript"></script>
        <script src="../../../../Scripts/json2.js" type="text/javascript"></script>  
    }
    <link href="@Url.Content("~/Content/Site.css", true)" rel="stylesheet" type="text/css" />

    <script src="@Url.Content("~/Scripts/jquery.min.js", true)" type="text/javascript"></script>

    <script src="@Url.Content("~/Scripts/PageCommon.js", true)" type="text/javascript"></script>

    <script src="@Url.Content("~/Fckeditor/fckeditor.js", true)" type="text/javascript"></script>

    <script src="@Url.Content("~/Common/GetRootPath.ashx", true)" type="text/javascript"></script>

    <script src="@Url.Content("~/Scripts/FloatDiv.js", true)" type="text/javascript"></script>

    <script src="@Url.Content("~/Scripts/json2.js", true)" type="text/javascript"></script>

    <script>
        if (top.boardtop) {
            top.boardtop.head_txt.innerText = "系统配置";
        }
    </script>

    @Html.DevExpress().GetStyleSheets(

        new StyleSheet { ExtensionType = ExtensionType.ListBox, Theme = DevExpressHelper.Theme }
)
    @Html.DevExpress().GetScripts(
        new Script { ExtensionType = ExtensionType.ListBox }
)

    <script>
        $(document).ready(function () {
            $("#toolMenu").smartFloat();
            var message = $('#hidMessage').val();
            if (message != "") {
                alert(message);
            }
        });
        /*选择信息类别*/
        function chooseDocCls(keyName, configClass) {
            var hdDicEntryJson = $("#hdDicEntryJson").val();
            if (hdDicEntryJson != "") {
                var dicEntryModel = JSON.parse(hdDicEntryJson);

                var entryModel = dicEntryModel[keyName + "_" + configClass];

                var obj = new Object();
                obj.Value = JSON.stringify(entryModel);
                var returnValue = window.showModalDialog(rootPath + "/Admin/Dialog/DocClsChooseTree", obj, "dialogWidth=450px;dialogHeight=550px");
                if (typeof (returnValue) != "undefined") {
                    var treeModelList = JSON.parse(returnValue);
                    dicEntryModel[keyName + "_" + configClass] = treeModelList;
                    $("#hdDicEntryJson").val(JSON.stringify(dicEntryModel));
                    var showText = "";
                    for (var i = 0; i < treeModelList.length; i++) {
                        showText += treeModelList[i].Value + ",";
                    }
                    if (showText != "") {
                        showText = showText.substring(0, showText.lastIndexOf(','));
                    }
                    var txtVal = ASPxClientButtonEdit.Cast(keyName + "_" + configClass);

                    txtVal.SetText(showText);
                }
            }
        }
        function MenuTop_emClick(source, e) {
            switch (e.item.name) {
                case "btnSave":
                    {
                        //保存
                        save()
                        break;
                    }
                case "btnCancel":
                    {
                        //取消
                        window.top.location.href = rootPath + "/Index";
                        break;
                    }
            }
        }
        /*保存*/
        function save() {
            form1.submit();
        }
    </script>

</head>
<body>
    @using (Html.BeginForm("Save", "Config", FormMethod.Post, new { id = "form1", @class = "tableFrom" }))
    {
        <div class="floatToolMenu" id="toolMenu" style="z-index: 99;">
            <iframe style="position: absolute; visibility: inherit; top: 0px; left: 0px; width: 100%; height: 28px; z-index: -1; background-color: #00CCFF; border-width: 0px; filter='progid:dximagetransform.microsoft.alpha(style=0,opacity=0)';"></iframe>
            @Html.DevExpress().Menu(settings =>
       {
           settings.Name = "toolBarMenu";
           settings.ItemAutoWidth = false;
           settings.Width = System.Web.UI.WebControls.Unit.Percentage(100);
           settings.Styles.Style.Border.BorderWidth = System.Web.UI.WebControls.Unit.Pixel(0);
           settings.Styles.Style.BorderTop.BorderWidth = System.Web.UI.WebControls.Unit.Pixel(1);
           settings.Items.Add(item =>
           {
               item.Name = "btnSave";
               item.Text = "保存";
               item.ClientEnabled = true;
               item.Image.Url = Url.Content("~/Content/ControlImages/filesave.png");

           });
           settings.Items.Add(item =>
           {
               item.Name = "btnDelete";
               item.Text = "取消";
               item.ItemStyle.ForeColor = System.Drawing.Color.Red;
               item.ClientEnabled = true;
               item.Image.Url = Url.Content("~/Content/ControlImages/cancel.png");

           });
           settings.ClientSideEvents.ItemClick = "function(source,e){MenuTop_emClick(source,e)}";
           settings.ItemLinkMode = ItemLinkMode.ContentBounds;
       }).GetHtml()
        </div>
        
        <fieldset>
            <legend>首页导航栏目(01)</legend>
            <table class="tableForm">
                @{List<ElingOA6_Admin_DSJCJ.Model.Config> configList = Model.Where(s => s.FConfigClass == ElingOA6_Admin_DSJCJ.Common.BaseStruct.ConfigClass.SYDHLM).ToList();
                  //configList = configList.OrderBy(s => s.FSeq).ToList();
                }
                @foreach (ElingOA6_Admin_DSJCJ.Model.Config configModel in configList)
                {
                    <tr>
                        <th style="width: 20%">
                            @configModel.FShowText:</th>
                        <td style="width: 80%" class="tdClass">
                            @Html.DevExpress().ButtonEdit(settings =>
                       {
                           settings.Name = configModel.FKeyName + "_" + configModel.FConfigClass;
                           settings.Width = 350;
                           if (configModel.FIsWithDocCls == "Y")
                           {
                               string showText = "";
                               foreach (ElingOA6_Admin_DSJCJ.Model.ConfigEntry configEntryModel in configModel.ConfigEntryList)
                               {
                                   showText += configEntryModel.FDocClsCd + ",";
                               }
                               if (showText != "")
                               {
                                   showText = showText.Substring(0, showText.LastIndexOf(','));
                               }
                               settings.Text = showText;
                               settings.Properties.Buttons.Add("选择目录");
                               settings.Properties.ClientSideEvents.ButtonClick = "function(s,e){chooseDocCls('" + configModel.FKeyName + "','" + configModel.FConfigClass + "')}";

                           }
                           else
                           {
                               settings.Text = configModel.FKeyValue;
                           }
                       }).GetHtml()
                        </td>
                    </tr>
                }
            </table>
        </fieldset>
        <fieldset>
            <legend>应用系统连接(02)</legend>
            <table class="tableForm">
                @{configList = Model.Where(s => s.FConfigClass == ElingOA6_Admin_DSJCJ.Common.BaseStruct.ConfigClass.ZHGLL).ToList();
                  //configList = configList.OrderBy(s => s.FSeq).ToList();
                }
                @foreach (ElingOA6_Admin_DSJCJ.Model.Config configModel in configList)
                {
                    <tr>
                        <th style="width: 20%">
                            @configModel.FShowText:</th>
                        <td style="width: 80%" class="tdClass">
                            @Html.DevExpress().ButtonEdit(settings =>
                       {
                           settings.Name = configModel.FKeyName + "_" + configModel.FConfigClass;
                           settings.Width = 350;
                           if (configModel.FIsWithDocCls == "Y")
                           {
                               string showText = "";
                               foreach (ElingOA6_Admin_DSJCJ.Model.ConfigEntry configEntryModel in configModel.ConfigEntryList)
                               {
                                   showText += configEntryModel.FDocClsCd + ",";
                               }
                               if (showText != "")
                               {
                                   showText = showText.Substring(0, showText.LastIndexOf(','));
                               }
                               settings.Text = showText;
                               settings.Properties.Buttons.Add("选择目录");
                               settings.Properties.ClientSideEvents.ButtonClick = "function(s,e){chooseDocCls('" + configModel.FKeyName + "','" + configModel.FConfigClass + "')}";

                           }
                           else
                           {
                               settings.Text = configModel.FKeyValue;
                           }
                       }).GetHtml()
                        </td>
                    </tr>
                }
            </table>
        </fieldset>
        @*<fieldset>
            <legend>财政业务类(03)</legend>
            <table class="tableForm">
                @{configList = Model.Where(s => s.FConfigClass == ElingOA6_Admin_DSJCJ.Common.BaseStruct.ConfigClass.CZYWL).ToList();
                  //configList = configList.OrderBy(s => s.FSeq).ToList();
                }
                @foreach (ElingOA6_Admin_DSJCJ.Model.Config configModel in configList)
                {
                    <tr>
                        <th style="width: 20%">
                            @configModel.FShowText:</th>
                        <td style="width: 80%" class="tdClass">
                            @Html.DevExpress().ButtonEdit(settings =>
                       {
                           settings.Name = configModel.FKeyName + "_" + configModel.FConfigClass;
                           settings.Width = 350;
                           if (configModel.FIsWithDocCls == "Y")
                           {
                               string showText = "";
                               foreach (ElingOA6_Admin_DSJCJ.Model.ConfigEntry configEntryModel in configModel.ConfigEntryList)
                               {
                                   showText += configEntryModel.FDocClsCd + ",";
                               }
                               if (showText != "")
                               {
                                   showText = showText.Substring(0, showText.LastIndexOf(','));
                               }
                               settings.Text = showText;
                               settings.Properties.Buttons.Add("选择目录");
                               settings.Properties.ClientSideEvents.ButtonClick = "function(s,e){chooseDocCls('" + configModel.FKeyName + "','" + configModel.FConfigClass + "')}";

                           }
                           else
                           {
                               settings.Text = configModel.FKeyValue;
                           }
                       }).GetHtml()
                        </td>
                    </tr>
                }
            </table>
        </fieldset>*@
        <fieldset>
            <legend>首页显示栏目(04)</legend>
            <table class="tableForm">
                @{configList = Model.Where(s => s.FConfigClass == ElingOA6_Admin_DSJCJ.Common.BaseStruct.ConfigClass.SYXSLM).ToList();
                  //configList = configList.OrderBy(s => s.FSeq).ToList();
                }
                @foreach (ElingOA6_Admin_DSJCJ.Model.Config configModel in configList)
                {
                    <tr>
                        <th style="width: 20%">
                            @configModel.FShowText:</th>
                        <td style="width: 80%" class="tdClass">
                            @Html.DevExpress().ButtonEdit(settings =>
                       {
                           settings.Name = configModel.FKeyName + "_" + configModel.FConfigClass;
                           settings.Width = 350;
                           if (configModel.FIsWithDocCls == "Y")
                           {
                               string showText = "";
                               foreach (ElingOA6_Admin_DSJCJ.Model.ConfigEntry configEntryModel in configModel.ConfigEntryList)
                               {
                                   showText += configEntryModel.FDocClsCd + ",";
                               }
                               if (showText != "")
                               {
                                   showText = showText.Substring(0, showText.LastIndexOf(','));
                               }
                               settings.Text = showText;
                               settings.Properties.Buttons.Add("选择目录");
                               settings.Properties.ClientSideEvents.ButtonClick = "function(s,e){chooseDocCls('" + configModel.FKeyName + "','" + configModel.FConfigClass + "')}";

                           }
                           else
                           {
                               settings.Text = configModel.FKeyValue;
                           }
                       }).GetHtml()
                        </td>
                    </tr>
                }
            </table>
        </fieldset>
        <fieldset>
            <legend>首页搜索栏目(05)</legend>
            <table class="tableForm">
                @{configList = Model.Where(s => s.FConfigClass == ElingOA6_Admin_DSJCJ.Common.BaseStruct.ConfigClass.SYSSLM).ToList();
                  //configList = configList.OrderBy(s => s.FSeq).ToList();
                }
                @foreach (ElingOA6_Admin_DSJCJ.Model.Config configModel in configList)
                {
                    <tr>
                        <th style="width: 20%">
                            @configModel.FShowText:</th>
                        <td style="width: 80%" class="tdClass">
                            @Html.DevExpress().ButtonEdit(settings =>
                       {
                           settings.Name = configModel.FKeyName + "_" + configModel.FConfigClass;
                           settings.Width = 350;
                           if (configModel.FIsWithDocCls == "Y")
                           {
                               string showText = "";
                               foreach (ElingOA6_Admin_DSJCJ.Model.ConfigEntry configEntryModel in configModel.ConfigEntryList)
                               {
                                   showText += configEntryModel.FDocClsCd + ",";
                               }
                               if (showText != "")
                               {
                                   showText = showText.Substring(0, showText.LastIndexOf(','));
                               }
                               settings.Text = showText;
                               settings.Properties.Buttons.Add("选择目录");
                               settings.Properties.ClientSideEvents.ButtonClick = "function(s,e){chooseDocCls('" + configModel.FKeyName + "','" + configModel.FConfigClass + "')}";

                           }
                           else
                           {
                               settings.Text = configModel.FKeyValue;
                           }
                       }).GetHtml()
                        </td>
                    </tr>
                }
            </table>
        </fieldset>
        
        <fieldset>
            <legend>科室导航栏目(06)</legend>
            <table class="tableForm">
                @{configList = Model.Where(s => s.FConfigClass == ElingOA6_Admin_DSJCJ.Common.BaseStruct.ConfigClass.KSDHLM).ToList();
                  //configList = configList.OrderBy(s => s.FSeq).ToList();
                }
                @foreach (ElingOA6_Admin_DSJCJ.Model.Config configModel in configList)
                {
                    <tr>
                        <th style="width: 20%">
                            @configModel.FShowText:</th>
                        <td style="width: 80%" class="tdClass">
                            @Html.DevExpress().ButtonEdit(settings =>
                       {
                           settings.Name = configModel.FKeyName + "_" + configModel.FConfigClass;
                           settings.Width = 350;
                           if (configModel.FIsWithDocCls == "Y")
                           {
                               string showText = "";
                               foreach (ElingOA6_Admin_DSJCJ.Model.ConfigEntry configEntryModel in configModel.ConfigEntryList)
                               {
                                   showText += configEntryModel.FDocClsCd + ",";
                               }
                               if (showText != "")
                               {
                                   showText = showText.Substring(0, showText.LastIndexOf(','));
                               }
                               settings.Text = showText;
                               settings.Properties.Buttons.Add("选择目录");
                               settings.Properties.ClientSideEvents.ButtonClick = "function(s,e){chooseDocCls('" + configModel.FKeyName + "','" + configModel.FConfigClass + "')}";

                           }
                           else
                           {
                               settings.Text = configModel.FKeyValue;
                           }
                       }).GetHtml()
                        </td>
                    </tr>
                }
            </table>
        </fieldset>
        

        
        
        @Html.Hidden("hidMessage", ViewData["message"])
        @Html.Hidden("hdDicEntryJson", ViewData["dicEntryJson"]);
    }
</body>
</html>
